import { base } from "./api";
import axios from "./http";
import qs from "qs";

const WEBSITE = {
  // 获取设备数据
  getData: params =>
    axios.get(`${base.URL}/oilSmoke/deviceInfo/selectDeviceInfo`, {
      params
    }),
  // 更新设备数据
  upData: params =>
    axios.post(
      `${base.URL}/oilSmoke/deviceInfo/editDeviceInfo`,
      qs.stringify(params)
    ),
  // 新增设备数据
  addData: params =>
    axios.post(
      `${base.URL}/oilSmoke/deviceInfo/addDeviceInfo`,
      qs.stringify(params)
    ),
  // 分配设置
  equipmentData: params =>
    axios.get(`${base.URL}/oilSmoke/role/selectByInfo`, { params }),

  // 设备地图
  getMapData1: params =>
    axios.get(`${base.URL}/oilSmoke/deviceInfo/selectByInfo`, { params }),
  getMapData: params =>
    axios.get(`${base.URL}/oilSmoke/role/selectByInfo`, { params }),

  getAdminist: params =>
    axios.get(`${base.Rurl}/selectRegiontownship_id`, { params }),
};

export default WEBSITE;
